<!DOCTYPE html>
<html>
<head>
    <title>全局配置</title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("oa:userconfig:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("oa:userconfig:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("oa:userconfig:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        	<form class="form-horizontal">
        		<div class="form-group">
				<div class="col-sm-2 control-label">提供商</div>
				<label class="radio-inline">
					<input v-if="userConfig.type != 'undefined'" type="radio" name="type" v-model="userConfig.type" value="1"/> 微信
				</label>
				<label class="radio-inline">
					<input v-if="userConfig.type != 'undefined'" type="radio" name="type" v-model="userConfig.type" value="2"/> 钉钉
				</label>
			
			</div>
        	
        	<div v-show="userConfig.type == 1">
			   <div class="form-group">
                   <div class="col-sm-2 control-label">appid</div>
                   <div class="col-sm-10">
                       <input type="text" class="form-control" v-model="userConfig.wxAppid" placeholder="第三方用户唯一凭证，即appid"/>
                   </div>
               </div>
						                    <div class="form-group">
                   <div class="col-sm-2 control-label">appsecret</div>
                   <div class="col-sm-10">
                       <input type="text" class="form-control" v-model="userConfig.wxSecret" placeholder="第三方用户唯一凭证密钥，即appsecret"/>
                   </div>
               </div>
						                    <div class="form-group">
                   <div class="col-sm-2 control-label">Token</div>
                   <div class="col-sm-10">
                       <input type="text" class="form-control" v-model="userConfig.wxToken" placeholder="Token"/>
                   </div>
               </div>
             </div>
             
             <div v-show="userConfig.type == 2">
			    <div class="form-group">
                   <div class="col-sm-2 control-label">appkey</div>
                   <div class="col-sm-10">
                       <input type="text" class="form-control" v-model="userConfig.dingAppkey" placeholder="应用的key,唯一标识"/>
                   </div>
               </div>
			   <div class="form-group">
                   <div class="col-sm-2 control-label">appsecret</div>
                   <div class="col-sm-10">
                       <input type="text" class="form-control" v-model="userConfig.dingAppsecret" placeholder="应用的密钥"/>
                   </div>
               </div>
                <div class="form-group">
                   <div class="col-sm-2 control-label">corpid</div>
                   <div class="col-sm-10">
                       <input type="text" class="form-control" v-model="userConfig.dingCorpid" placeholder="相关企业id"/>
                   </div>
               </div>
               
               <div class="form-group">
                   <div class="col-sm-2 control-label">解密token</div>
                   <div class="col-sm-10">
                       <input type="text" class="form-control" v-model="userConfig.dingToken" placeholder="加解密需要用到的token，普通企业可以随机填写"/>
                   </div>
               </div>
               <div class="form-group">
                   <div class="col-sm-2 control-label">数据加密密钥</div>
                   <div class="col-sm-10">
                       <input type="text" class="form-control" v-model="userConfig.dingAesKey" placeholder="长度为43个字符，从a-z, A-Z, 0-9共62个字符中选取"/>
                   </div>
               </div>
               <div class="form-group">
                   <div class="col-sm-2 control-label">回调url</div>
                   <div class="col-sm-10">
                       <input type="text" class="form-control" v-model="userConfig.dingUrl" placeholder="接收事件回调的url"/>
                   </div>
               </div>
			 </div>			          
        	</div>
			<div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                <!-- &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/> -->
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/oa/userconfig.js?_${.now?long}"></script>
</body>
</html>